#ifndef __INITIATOR_TOP_H__
#define __INITIATOR_TOP_H__

#include <systemc>

#include "tlm.h"
#include "tlm_utils/simple_initiator_socket.h"
#include "tlm_utils/simple_target_socket.h"

using namespace sc_core; //can let sc_core::sc_module -> sc_module
using namespace sc_dt;
using namespace std;
using namespace tlm_utils;


class initiator_top: public sc_core::sc_module{

public:
  SC_HAS_PROCESS(initiator_top);
  tlm_utils::simple_initiator_socket<initiator_top> socket;
  initiator_top(const sc_module_name& name): socket("socket"){ //SC_CTOR(initiator_top): socket("socket"){
    entry();
  }

  void entry();
  void thread_process();
  virtual void invalidate_direct_mem_ptr(sc_dt::uint64 start_range, sc_dt::uint64 end_range);

private:
  int           data;
  bool          dmi_ptr_valid;
  tlm::tlm_dmi  dmi_data;

};

#endif /* __INITIATOR_TOP_H__ */
